package com.iscas.tech.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iscas.tech.entity.AtStpic;
import com.iscas.tech.param.AtStpicPageParam;
import com.iscas.tech.vo.AtStpicQueryVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 科技成果图片信息表 Mapper 接口
 *
 * @author yangyi
 * @since 2020-10-26
 */
@Repository
public interface AtStpicMapper extends BaseMapper<AtStpic> {


    /**
     * 获取分页对象
     *
     * @param page
     * @param atStpicPageParam
     * @return
     */
    IPage<AtStpicQueryVo> getAtStpicPageList(@Param("page") Page page, @Param("param") AtStpicPageParam atStpicPageParam);

    /**
     * @param techGainId  科技成果ID
     * @param techPicType {@link com.iscas.tech.bo.TechPicType}科技成果图片分类
     * @return 获取科技成果下属所有图片
     */
    List<AtStpicQueryVo> getByGainId(@Param("stId") Integer techGainId, @Param("type") Integer techPicType);

    /**
     * @param id 业务图片绑定ID
     * @return 删除科技成果图片
     */
    boolean deleteTechPic(@Param("id") Long id);

    /**
     * @param techGainId 科技成果ID
     */
    void deleteByGainId(@Param("stId") Integer techGainId);
}
